package com.wuhunyu.controller;

import com.wuhunyu.commonutils.result.CommonResult;
import com.wuhunyu.service.OssService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * 文件上传控制器
 *
 * @author wuhunyu
 * @version 1.0
 * @date 2021-01-15 22:02
 */
@RestController
@RequestMapping("/oss")
//@CrossOrigin
public class OssController {

    @Autowired
    private OssService ossService;

    @PostMapping("/updateFile")
    public CommonResult fileUpload(MultipartFile file) {
        return ossService.uploadFile(file);
    }

}
